package de.thw.web.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

@Entity
public class User extends AbstractModel {

	protected String Name;

	protected String Firstname;

	protected String Lastname;

	protected String Email;

	@ManyToMany
	protected List<Team> Groups;

	@ManyToMany
	protected List<Job> Jobs;

	@OneToMany
	protected List<Permission> Permissions;

	// /////////////////////////////////////////////////////////////////////////////

	public String getName() {
		return this.Name;
	};

	public void setName(String name) {
		this.Name = name;
	};

	public String getFirstname() {
		return this.Firstname;
	};

	public void setFirstname(String name) {
		this.Firstname = name;
	};

	public String getLastname() {
		return this.Lastname;
	};

	public void setLastname(String name) {
		this.Lastname = name;
	};

	public String getEmail() {
		return this.Email;
	};

	public void setEmail(String email) {
		this.Email = email;
	};

	public List<Team> getGroups() {
		return this.Groups;
	};

	public void setGroups(List<Team> list) {
		this.Groups = list;
	};

	public void addGroup(Team group) {
		this.Groups.add(group);
	};

	public List<Job> getJobs() {
		return this.Jobs;
	};

	public void setJobs(List<Job> list) {
		this.Jobs = list;
	};

	public void addJob(Job job) {
		this.Jobs.add(job);
	};

	public List<Permission> getPermissions() {
		return this.Permissions;
	};

	public void setPermissions(List<Permission> list) {
		this.Permissions = list;
	};

	public void addPermission(Permission permission) {
		this.Permissions.add(permission);
	};

};